package com.utils.wsjava;

import java.net.URI;
import java.net.URISyntaxException;

public enum WSSourceClient {
    WSSOURCE;
    private WebsocketClient connection = null;
    private String uri = "ws://192.168.0.82:9007/ws";

    private WSSourceClient() {
        try {
            connection = new WebsocketClient(new URI(uri));
            connection.connect();
            boolean flag = true;
            while(flag){
                if(connection.isOpen()){
                    flag = false;
                }
            }
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
    }
    public WebsocketClient getConnection() {
        return connection;
    }
}